﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Index</title>
    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="../../Content/Site.css" />
    <link rel="stylesheet" type="text/css" href="../../Content/Form.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/plugins/jquery-ui-1.8/css/smoothness/jquery-ui-1.8.5.custom.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/plugins/jquery-jqGrid-3.7.2/css/ui.jqgrid.css" />
    <!-- JS Default -->
    <script type="text/javascript" src="../../Scripts/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/Default.js"></script>
    <script type="text/javascript" src="../../Scripts/Extension.js"></script>
    <!-- JS Plugins -->
    <script type="text/javascript" src="../../Scripts/plugins/jquery-ui-1.8/js/jquery-ui-1.8.5.custom.min.js"></script>
<script type="text/javascript" src="../../Scripts/plugins/jquery-selectmenu/ui.selectmenu.js"></script>
    <script type="text/javascript" src="../../Scripts/plugins/jquery-jqGrid-3.7.2/js/i18n/grid.locale-pt-br.js"></script>
    <script type="text/javascript" src="../../Scripts/plugins/jquery-jqGrid-3.7.2/js/jquery.jqGrid.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            ButtonTheme();
            $("#table").jqGrid({
                url: '/Fornecedores/List',
                datatype: 'json',
                mtype: 'GET',
                colNames: ['Código', 'Nome', 'Ativo'],
                colModel: [
                    { name: 'COD_FORN', index: 'COD_FORN', width: 100, align: 'right' },
                    { name: 'NOME_PESSOA', index: 'NOME_PESSOA', width: 300 },
                    { name: 'ATIVO_FORN', index: 'ATIVO_FORN', width: 60, align: 'center' }
                ],
                pager: '#pager',
                width: '100%',
                height: '100%',
                rowNum: 10,
                rowList: [10, 20, 30],
                sortname: 'COD_FORN',
                sortorder: 'asc',
                viewrecords: true,
                ondblClickRow: function (id) { loadOption('/Fornecedores/Details/' + id, true); }
            });
        });
    </script>
</head>
<body>
    <div class="cabecalho ui-state-highlight">
        <span class="icolst" />
        <span class="txt">
            <%= Html.Encode("Cadastro de Fornecedores") %>
        </span>
    </div>
    <fieldset class="container transparent">            
        <label class="input80">
            <button type="button" class="documentcommand" onclick="loadOption('/Fornecedores/Edit', true);">Novo Fornecedor</button>
        </label>
    </fieldset>
    <fieldset class="container transparent">
        <table id="table"></table>
        <div id="pager"></div>
    </fieldset>
</body>
</html>